fix: add id/name attributes and labels to form fields for accessibili…#399
fix: add id/name attributes and labels to form fields for accessibili…#399ARUSHIGULBHILE wants to merge 1 commit into
Conversation
✅ Deploy Preview for github-spy ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
📝 WalkthroughWalkthroughThis pull request addresses accessibility violations across form fields in the application by adding missing ChangesForm Field Accessibility Enhancements
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Suggested labels
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
🎉 Thank you @ARUSHIGULBHILE for your contribution. Please make sure your PR follows https://github.com/GitMetricsLab/github_tracker/blob/main/CONTRIBUTING.md#-pull-request-guidelines
There was a problem hiding this comment.
🧹 Nitpick comments (1)
src/pages/Tracker/Tracker.tsx (1)
300-326: ⚡ Quick winConsider adding explicit label association for MUI Select.
For more explicit accessibility, consider adding an
idto theInputLabeland alabelIdto theSelect:♻️ Optional improvement for explicit label association
- <FormControl sx={{ minWidth: 150 }}> - <InputLabel sx={{ fontSize: "14px" }}>State</InputLabel> + <FormControl sx={{ minWidth: 150 }}> + <InputLabel id="state-select-label" sx={{ fontSize: "14px" }}>State</InputLabel> <Select id="state-select" + labelId="state-select-label" name="state-select" autoComplete="off"This makes the label-to-input association more explicit and aligns with Material-UI best practices, though the current implementation with the
label="State"prop should work correctly.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/pages/Tracker/Tracker.tsx` around lines 300 - 326, Add explicit label association for the MUI Select by giving the InputLabel an id (e.g., "state-select-label") and passing that id into the Select's labelId prop; update the InputLabel component (InputLabel) to include the id and update the Select component (Select with id "state-select") to include labelId="state-select-label" so the label and select are explicitly linked for accessibility.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@src/pages/Tracker/Tracker.tsx`:
- Around line 300-326: Add explicit label association for the MUI Select by
giving the InputLabel an id (e.g., "state-select-label") and passing that id
into the Select's labelId prop; update the InputLabel component (InputLabel) to
include the id and update the Select component (Select with id "state-select")
to include labelId="state-select-label" so the label and select are explicitly
linked for accessibility.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 2dba50d1-a867-47f5-a560-1803466fad46
📒 Files selected for processing (5)
src/components/Footer.tsxsrc/pages/Contact/Contact.tsxsrc/pages/Login/Login.tsxsrc/pages/Signup/Signup.tsxsrc/pages/Tracker/Tracker.tsx
Related Issue
Closes #388
Description
Added missing
id,name, andlabelattributes to form fields across the application to resolve accessibility warnings.Files changed:
src/components/Footer.tsx- newsletter email inputsrc/pages/Contact/Contact.tsx- name, email, subject, message fieldssrc/pages/Login/Login.tsx- email, password fieldssrc/pages/Signup/Signup.tsx- username, email, password fieldssrc/pages/Tracker/Tracker.tsx- MUI Select component (State filter)Changes made:
idandnameattributes to all form inputs<label>tags withhtmlFormatching theidautoComplete="off"to MUI Select componentsr-onlyclass for screen-reader accessible labelsHow Has This Been Tested?
npm run devlocallyScreenshot (After Fix)
The original warning "A form field element should have an id or name attribute" is gone. Only unrelated autocomplete and label warnings remain (separate issues).

Type of Change
Summary by CodeRabbit
Release Notes